<?php
/**
 * Created by PhpStorm.
 * User: Aliaksei Lazerka
 * Date: 9/28/14
 * Time: 12:29 PM
 */

namespace log;

if (!defined('NYMPH_ROOT')) {
  define('NYMPH_ROOT', dirname("../../../" . __FILE__));
  require(NYMPH_ROOT . '/local/loader/kernel/classes/URLClassLoader.php');
}

/**
 * The BrowserLogger class is used to log in html
 */
class BrowserLogger extends Logger
{

  /**
   * (PHP 5)<br/>
   * info level
   * @param string $message
   */
  function info($message)
  {
    $style = "style = 'color: " . Logger::INFO_COLOR . "'";
    echo "<div " . $style . ">[" . Logger::INFO_LEVEL . "] " . $this->convertForLog($message) . "</div>";
  }

  /**
   * (PHP 5)<br/>
   * error level
   * @param string $message
   */
  function debug($message)
  {
    $style = "style = 'color: " . Logger::DEBUG_COLOR . "'";
    echo "<div " . $style . ">[" . Logger::DEBUG_LEVEL . "] " . $this->convertForLog($message) . "</div>";
  }

  /**
   * (PHP 5)<br/>
   * debug level
   * @param string $message
   */
  function error($message)
  {
    $style = "style = 'color: " . Logger::ERROR_COLOR . "'";
    echo "<div " . $style . ">[" . Logger::ERROR_LEVEL . "] " . $this->convertForLog($message) . "</div>";
  }
}